def x_where(x, th=0, a=1, b=0):
    '''
    If x is greater than th, return a, otherwise, b.
    :param x:
    :param th:
    :param a:
    :param b:
    :return:
    '''
    r = a if x > th else b
    return r


data = [
    [0.22, 0.5],
    [0.99, 0.5],
    [-20],
    [25],
    [101, 100, 10, 0]
]

for params in data:
    print(f'{params} => {x_where(*params)}')
